using System;

	public class StateMechanicScript
	{
		public delegate void MyEventHandler(object sender, System.EventArgs e);
		public StateMechanicScript ( int stateNum, MyEventHandler stateFunction, MyEventHandler breakFunction )
		{
			stateChane = new bool[stateNum];
			this.stateFunction = stateFunction;
			this.breakFunction = breakFunction;
		}
		
		public void SetStateChange( int stateIndex, bool canChange )
		{
			stateChane[stateIndex] = canChange;
		}
		
		public bool CanChangeTo ( int stateIndex )
		{
			return stateChane[stateIndex];
		}
		
		public void StateFuntion( System.EventArgs e )
		{
			stateFunction( this, e );
		}
		
		public void BreakFunction ( System.EventArgs e)
		{
			breakFunction( this, e );
		}
		
		public bool[] stateChane ;
		public MyEventHandler stateFunction;
		public MyEventHandler breakFunction;
	}


